function groupingArray (array: any[], pagination: number = 3): any[] {
  const tempChildList: any[] = []
  const tempList: any[] = []
  array.forEach((item, index) => {
    tempChildList.push(item)
    if ((index + 1) % pagination === 0) {
      tempList.push(tempChildList)
      tempChildList.splice(0, tempChildList.length)
    }
  })
  return tempList
}

export default groupingArray
